﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using demo.BLL;

namespace WebApplication1.Areas.Manage.Controllers
{
    public class LoginController : Controller
    {
        public UserBLL bll = new UserBLL();
        // GET: Manage/Login
        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 获得验证码
        /// </summary>
        /// <returns></returns>
        public ActionResult GetLoginValCode()
        {
            byte[] bytes = bll.GetLoginValCode();
            return File(bytes, "img/jpg");
        }

        //[HttpPost]
        //public ActionResult Login(string account,string password,string checkCode)
        //{
        //    return this.Json(bll.DoLogin(account, password, checkCode)) ;
        //}

        [HttpPost]
        public ActionResult Login(string Account, string Password)
        {
            return this.Json(bll.DoLogin(Account, Password));
        }
    }
}